package com.hzw.saas.common.flow.pojo.enums;

/**
 * @Description
 * @Date 2021/8/7 12:56 上午
 * @Created by sonam
 */
public enum FlowNodeStatus {
    END_NODE(-1,"结束节点"),
    START_NODE(0, "起始节点"),
    USER_TASK_NODE(1, "用户任务节点"),
    ;

    /**
     * 状态代号≤
     */
    private final int code;

    /**
     * 状态文本
     */
    private final String text;

    FlowNodeStatus(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int code() {
        return code;
    }

    public String text() {
        return text;
    }

    public static FlowNodeStatus instance(int code) {
        for (FlowNodeStatus value : values()) {
            if (value.code() == code) {
                return value;
            }
        }
        return null;
    }

}
